#include "stm32f10x.h" // Device header

void Delay_us(uint32_t us){
	
	SysTick->LOAD = 72*us;
	
	SysTick->VAL = 0;
	
	SysTick->CTRL = 0x00000005;
	
	while(!(SysTick->CTRL & 0x00010000));
	
	SysTick->CTRL = 0x00000004;
}


void Delay_ms(uint32_t ms){

	while(ms--){
		Delay_us(1000);
	}

}


void Delay_sec(uint32_t sec){

	while(sec--){
		Delay_ms(1000);
	}

}

